package net.maku.events.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import net.maku.framework.common.utils.Result;
import net.maku.events.service.UserLikesService;
import org.springframework.web.bind.annotation.*;


/**
 * 用户点赞记录
 *
 * @author 阿沐 babamu@126.com
 * @since 1.0.0 2025-03-22
 */
@RestController
@RequestMapping("events/user_likes")
@Tag(name = "用户点赞记录")
@AllArgsConstructor
public class UserLikesController {
    private final UserLikesService userLikesService;

    @GetMapping("/give/or/cancel/{snapshotId}")
    @Operation(summary = "保存")
    public Result<String> giveOrCancel(@PathVariable("snapshotId") Long snapshotId) {
        userLikesService.giveOrCancel(snapshotId);
        return Result.ok();
    }
}